package com.os.sys.config;

import com.os.sys.interceptor.JwtInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * 本功能暂未使用
 * 正常的思路是在这里执行权限验证，但是不知道如何把静态资源，jsp等资源都排除出去，所在暂时改为了filter的方式实验
 * 参见：Controller.fileter.AuthFilter
 */
@Configuration
public class InterceptorConfig {
    //.excludePathPatterns("/index.html","/","/user/login");
    @Autowired
    private JwtInterceptor jwtInterceptor;

    protected void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器要声明拦截器对象和要拦截的请求
        //registry.addInterceptor(jwtInterceptor).excludePathPatterns("/kendo/css/blue/**.css");
//        registry.addInterceptor(jwtInterceptor)
//                .addPathPatterns("/user")
//                .excludePathPatterns("**");
                //.excludePathPatterns("/include.jsp","/","/user/login","/js/**","/kendo/**","/common/**");



//public class InterceptorConfig extends WebMvcConfigurationSupport {
//
//    @Autowired
//    private JwtInterceptor jwtInterceptor;
//    protected void addInterceptors(InterceptorRegistry registry) {
//        //注册拦截器要声明拦截器对象和要拦截的请求
////        registry.addInterceptor(jwtInterceptor)
////                .addPathPatterns("/**")
////                .excludePathPatterns("/**/login/**");
//        registry.addInterceptor(jwtInterceptor)
//                .addPathPatterns("/**/sys/**")
//                .excludePathPatterns("/**");
//    }
//}
    }
}